package com.xrc.HomeWork.jicheng;

public class Account {

    private int id;
    protected double balance;
    private double annualInterestRate;

    public Account() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnualInterestRate() {
        return annualInterestRate;
    }

    public void setAnnualInterestRate(double annualInterestRate) {
        this.annualInterestRate = annualInterestRate;
    }
    public double getMonthlyInterest(){
        return 1;
    }
    public void withdraw(double amount){
        if(amount>balance){
            System.out.println("您的余额不足");
            System.out.println("您的账户余额："+balance);

        }else {
            balance=balance-amount;
            System.out.println("您的账户余额："+balance);


        }
    }
    public void deposit( double amount){
        balance+=amount;
        System.out.println("您的余额为："+balance+"\n月利率为："+(0.045/12));
    }
}

